import grails.test.GrailsUnitTestCase
import ratemymacclass.FindAClassService
import ratemymacclass.Course
import ratemymacclass.Professor
import ratemymacclass.Rating
/**
 * Created by IntelliJ IDEA.
 * User: rktamakloe
 * Date: 5/3/11
 * Time: 11:50 PM
 * To change this template use File | Settings | File Templates.
 */
class SearchIntegrationTests extends GrailsUnitTestCase {
    def findAClassService

    void testSearch() {

        def searchService = new FindAClassService()

        assertEquals(searchService.findClass("Show").size(), 0)

        def c = new Course(title: "Show and Tell", department: "DARK", courseNum: 200)
        def p = new Professor(firstName: "Ruddi", lastName: "Tamakloe", department: "TSEW")

        c.save(failOnError: true)
        p.save(failOnError: true)

        assertEquals(searchService.findClass("Show").size(), 1)
        assertEquals(searchService.findProfessor("Ruddi").size(), 1)

    }
}
